<template>
  <div>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="参数名">
        <el-select v-model="filedName" filterable placeholder="请选择" style="width: 240px">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="参数描述">
        <el-select v-model="fileVDesc" filterable placeholder="请选择" style="width: 240px">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
    </el-form>

  </div>
</template>

<script>
import * as cache from '@/utils/cache';

export default {
  name: 'MapBean',
  data() {
    return {
      
      options: [],
      filedName: '',
      fileVDesc: ''
    };
  },
  mounted() {
    this.loadFromLocalStorage();
  },
  methods: {
    loadFromLocalStorage() {
      try {
        const excelList = cache.get('excelList');
        if (!excelList || excelList.length === 0) {
          console.warn('No data found in localStorage under key "excelList".');
          return;
        }

        this.options = excelList[0].map(item => {
          return {
            label: item,
            value: item
          };
        });
        console.log('Loaded data from localStorage:', this.excelData);
      } catch (error) {
        console.error('Error loading data from localStorage:', error);
      }
    }
  }
};
</script>

<style scoped>
/* 你可以在这里添加自定义样式 */
</style>